bAND

[Function] - Binary AND of two values


Syntax:

a bAND b

Parameters:

a,b: Two integer numbers

Description:

Performs the Bitwise Conjunction and returns 1 for every bit if and only if both bits are 1. Can be used for masking Bits.

Examples:


PRINT 255 bAND 7


DIM adr AS UINTEGER
FOR adr=16384 TO 22527
	POKE adr,PEEK adr&170
NEXT adr

The first of above function, when called, returns 7. The second is a small program which will delete every 2nd pixel of the display.


a AND b
a b Result
0 0 0
0 1 0
1 0 0
1 1 1

Notes:

See also:

bNOT, bOR, bXOR


Supported Plattforms:

ZX Spectrum